define(function(require) {
    var PuthinkApp = require('app');

    //vue 组件
    var html =  require('template_js/component');
    $("body").append(html);
    require("js/component");
    //zach
    //配置文件
    var params = {
        apiDomain: seajs.data.apiDomain?seajs.data.apiDomain:'https://www.bestsmartbee.com/', //接口域名 不带"/"
        domain: '', //网站域名  不带"/",
        appname: seajs.data.appname,
        bindPhone:true,
        debug: seajs.data.debug ? seajs.data.debug : false,
        versions: seajs.data.versions ? seajs.data.versions : '6.8',
        userVersions: seajs.data.userVersions ? seajs.data.userVersions : '6.9'
    };



    //app 实例之后 ， 只执行一次
    PuthinkApp.afterInit = function() {
        var _hmt = _hmt || [];

        
    };

    //页面显示时引用，每次都会执行
    PuthinkApp.pageShow = function(params) {
        var name = params.name;
       

       
    };


    //实例化app
    window.app = new PuthinkApp(params);
    app.login(function() {
         app.init();
     });

    app.add_goods=function(id, callblack) {
                app.showLoad();
                app.get("/sns/topic/thumb_up", {
                    topic_id: id
                }, function(data) {
                    app.hideLoad();
                    if (data.code != 200) {
                        app.alert(data.msg);
                    } else {
                        var msg = data.data.type == "add" ? "得到赞一杯，开心" : "居然不爱我了，伤心";
                        app.alert(msg);
                    }
                    callblack ? callblack(data) : "";
                });
            };
 


});